package hello

import (
	"fmt"
	"github.com/gogf/gf/errors/gerror"
	"github.com/gogf/gf/net/ghttp"
)

func OpenFile() error {
	return gerror.New("permission denied")
}

func OpenConfig() error {
	return gerror.Wrap(OpenFile(),"configuration file opening failed")
}

func ReadConfig() error {
	return gerror.Wrap(OpenConfig(),"reading configuration failed")
}

func TestError(r *ghttp.Request) {
	fmt.Printf("%+v",ReadConfig())
	r.Response.Write("TestError")
}
